Creating running totals
Creating running totals in a list
Running totals are totals that are displayed generally on a record by record basis. They total all records (in the report, in the group, and so on) up to and including the current record.
The most basic form of a running total is a single running total maintained throughout a list. In this tutorial, you will create this kind of report by setting up a running total for a list of order amounts.
Note: Running total fields are prefixed by the # sign.
To create a running total in a list
- To get started, create a report using the sample database, Xtreme.mdb. Link the Customer and Orders tables, and then place the following fields from left to right in the Details section:
{customer.CUSTOMER NAME}
{orders.ORDER ID}
{orders.ORDER AMOUNT}
- On the Insert menu, click Field Object.
The Field Explorer dialog box appears.
Select Running Total Fields and click New.
The Create Running Total Field dialog box appears.
- Enter the name "TotalOrders" in the Running Total Name box.
- Highlight {orders.ORDER AMOUNT} in the Available Tables and Fields box, and use the first arrow button to move it over to the Field to summarize box.
- Select sum from the Type of summary list.
- In the Evaluate section of the dialog box, click On change of field, and select {orders.ORDER ID} as the On change of field.
The running total will execute each time this field changes.
- In the Reset section of the dialog box, click Never (this gives you a running total that never resets; that is, the running total continues throughout the report).
- Click OK to save the running total field.
The program returns you to the Field Explorer dialog box.
- Insert the running total field in the Details section of the report, just to the right of {orders.ORDER AMOUNT}.
Related topics